<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;
// 定义资源路由
Route::get('login', 'admin/Login/index');
Route::post('dologin', 'admin/Login/dologin');
Route::resource('users', 'admin/User');
Route::get('userrole', 'admin/User/rolelist');
Route::get('useradd', 'admin/User/add');
Route::post('userdoadd', 'admin/User/doadd');
Route::post('saverole', 'admin/User/saverole');
Route::resource('roles', 'admin/Role');
Route::get('noderole', 'admin/Role/rolelist');
Route::get('roleadd', 'admin/Role/add');
Route::get('roledoadd', 'admin/Role/doadd');
Route::post('savenode', 'admin/Role/savenode');
Route::resource('nodes', 'admin/Node');
Route::get('nodeadd', 'admin/Node/add');
Route::post('nodedoadd', 'admin/Node/doadd');
Route::get('nologin', 'admin/Login/nologin');
Route::get('admin','admin/Index/index');
Route::get('/','index/Index/index');
//后台影片管理
Route::get('filmlist','admin/Film/index');
//后台影片添加页面
Route::get('filmadd','admin/Film/add');
//后台执行影片添加
Route::post('filmdoadd','admin/Film/doadd');
//后台影片编辑页面
Route::rule('filmedit/:id','admin/Film/edit');
//后台执行影片编辑
Route::put('filmdoedit','admin/Film/doedit');
//后台执行影片删除
Route::resource('filmdelete','admin/Film');
//后台订单列表页
Route::get('order','admin/Order/index');
//后台订单删除
Route::get('deleteo/:id','admin/Order/delete');
//后台影片搜索
Route::post('selectf','admin/Film/select');
//后台影院搜索
Route::post('selectc','admin/Cinema/select');

//后台轮播图列表
Route::get('pic','admin/Web/show');

//后台轮播图添加页面
Route::get('picadd','admin/Web/add');

//后台执行轮播图添加
Route::post('picdoadd','admin/Web/doadd');

//后台轮播图删除
Route::get('picdelete/:id','admin/Web/delete');

//后台电影详情
Route::get('infooo','admin/Film/info');
















//前台个人中心
Route::get('center','index/Center/index');

//前台跳转热映影片
Route::rule('hortfilm','index/Hortfilm/index');
//前台跳转到电影详情页
Route::rule('filminfo/:id','index/Hortfilm/filminfo');
//前台登录注册
Route::get('login_1', 'index/Login/index');
Route::post('dologin_1', 'index/Login/dologin');
Route::get('register', 'index/Login/register');
Route::get('pass', 'index/Login/pass');
Route::post('doregister', 'index/Login/doregister');
Route::get('nologin_1', 'index/Login/nologin');

//跳转到前台个人资料修改
Route::rule('infoedit', 'index/Center/infoedit');

//执行前台个人资料修改
Route::rule('infodoedit', 'index/Center/infodoedit');

//跳转前台个人头像修改
Route::rule('icon', 'index/Center/icon');

//执行前台个人头像修改
Route::rule('doicon', 'index/Center/doicon');

//跳转前台密码修改页
Route::rule('passedit', 'index/Center/passedit');

//执行前台密码修改
Route::post('passdoedit', 'index/Center/passdoedit');

//前台跳转订单列表
Route::get('myorder', 'index/Center/myorder');

// //前台电影类型ajax
Route::get('filmtype','index/Hortfilm/type');









// Route::rule('路由表达式','路由地址','请求类型','路由参数（数组）','变量规则（数组）');
/*
    路由规则:URL访问规则（包括静态规则和动态规则）,只有符合规则的路由才能正确访问;
    路由地址:实际访问的地址（可以是控制器操作、类的方法或者闭包）;
    请求类型:表示当前路由生效使用的请求类型,包括GET/POST/PUT/DELETE等,如果希望任何请求都能访问使用*号（默认值）。
    路由参数:路由匹配的条件约束或设置参数（用于检测或者解析）;
    路由变量:路由规则里面的动态变量以及PATH_INFO里面的参数都称之为路由变量;
    变量规则:路由规则中的变量的匹配规则（正则表达式）;

    支持任意请求规则
    Route::rule('new/:id','News/update');
    定义GET请求路由规则
    Route::get('new/:id','News/read');
    定义POST请求路由规则
    Route::post('new/:id','News/update');
    定义PUT请求路由规则
    Route::put('new/:id','News/update');
    定义DELETE请求路由规则
    Route::delete('new/:id','News/delete');
    所有请求都支持的路由规则
    Route::any('new/:id','News/read');
*/

// Route::get('admin','admin/index/index');
// Route::get('/','index/index/index');
//Route::post('ppp','index/index/ppp');
//Route::any('ooxx','index/index/index');

// 路由规则参数
// 无参
//Route::get('user','index/index/user');
// 必传参数
//Route::get('user/:id','index/index/user');
// 可选参数
//Route::get('user/[:id]','index/index/user');
// 匹配参数
//Route::get('user/[:id]$','index/index/user');

// 闭包
//Route::get('user/:id', function ($id){
//    return '1234567890-------'.$id;
//});

// 路由参数
//Route::get('userlist', 'admin/user/index', ['ext'=>'html|shtml']);

// 变量规则  越容易匹配的越往后放,越具体的越往前放
//http://tp5.com/index/blog/index/id/55.html
//http://tp5.com/index/blog/read/name/laowang.html
//http://tp5.com/index/blog/article/year/2018/month/03.html

//Route::get('blog/:year/:month', 'index/blog/article', ['method'=>'get'], ['year'=>'\d{4}', 'month'=>'\d{2}']);
//Route::get('blog/:id', 'index/blog/index', ['method'=>'get'], ['id'=>'\d+']);
//Route::get('blog/:name', 'index/blog/read', ['method'=>'get'], ['name'=>'\w+']);

// 路由分组
Route::group('blogs', [
    ':year/:month' => [
        'index/blog/article',
        ['method'=>'get'],
        ['year'=>'\d{4}', 'month'=>'\d{2}']
    ],
    ':ids' => [
        'index/blog/index',
        ['method'=>'get'],
        ['id'=>'\d+']
    ],
    ':name' => [
        'index/blog/read',
        ['method'=>'get'],
        ['name'=>'\w+']
    ]
]);


// Route::get('login', 'admin/Login/index');
// Route::post('dologin', 'admin/Login/dologin');
// Route::resource('users', 'admin/User');
// Route::get('userrole', 'admin/User/rolelist');
// Route::get('useradd', 'admin/User/add');
// Route::post('userdoadd', 'admin/User/doadd');
// Route::post('saverole', 'admin/User/saverole');
// Route::resource('roles', 'admin/Role');
// Route::get('noderole', 'admin/Role/rolelist');
// Route::get('roleadd', 'admin/Role/add');
// Route::get('roledoadd', 'admin/Role/doadd');
// Route::post('savenode', 'admin/Role/savenode');
// Route::resource('nodes', 'admin/Node');
// Route::get('nodeadd', 'admin/Node/add');
// Route::post('nodedoadd', 'admin/Node/doadd');

// Route::get('nologin', 'admin/Login/nologin');
//Route::get('users/show/:id', 'reset/Stu/readpage');


// index
//Route::get('login_1', 'index/Login/index');
//Route::post('dologin_1', 'index/Login/dologin');
//Route::get('register', 'index/Login/register');
//Route::get('pass', 'index/Login/pass');
//Route::post('doregister', 'index/Login/doregister');
Route::post('sou', 'index/Index/sou');
Route::resource('indexcinema', 'index/Cinema');
Route::get('cinemacha', 'index/Cinema/cha');
Route::post('classification', 'index/Cinema/classification');
Route::get('cinemaxq/:id', 'index/Cinema/cinema');
Route::post('ajaxsort/:id', 'index/Cinema/ajaxsort');
Route::get('seat/:id', 'index/Seat/index');
Route::post('order', 'index/Seat/save');

// admin1
Route::get('cinemaadd', 'admin/Cinema/add');
Route::get('cinema', 'admin/Cinema/create');
Route::post('cinemasave', 'admin/Cinema/save');
Route::get('cinemaexit', 'admin/Cinema/edit');
Route::post('cinemaupdate', 'admin/Cinema/update');
Route::delete('cinemadelete/:id', 'admin/Cinema/delete');
Route::resource('studio', 'admin/Studio');
Route::resource('sort', 'admin/Sort');
Route::get('ajaxstudio/:id', 'admin/Sort/ajaxsort');
Route::get('ajaxdate/:id', 'admin/Sort/ajaxdate');

// URL生成
//Route::get('url', 'index/index/url');

// DB类的操作
//Route::get('test', 'admin/test/index');
// 事务操作
//Route::get('sw', 'admin/test/sw');

//  API
//Route::get('btc', 'index/btc/index');




return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];